package com.egide;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

//Instances of this class are fragments representing a single
//object in our collection.
public class ObjectFragment extends Fragment {
 public static final String ARG_OBJECT = "object";

 @Override
 public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState) {
     // The last two arguments ensure LayoutParams are inflated
     // properly.
     Bundle args = getArguments();
     View rootView = null;
     
     if(args.getInt(ARG_OBJECT) == 1){
    	 rootView = inflater.inflate(R.layout.page, container, false);
     }else{
    	 rootView = inflater.inflate(R.layout.fragment_collection_object, container, false);
    	 ((TextView) rootView.findViewById(android.R.id.text1)).setText("E "+Integer.toString(args.getInt(ARG_OBJECT)));
     }
     
     return rootView;
 }
}
